package com.clei.utils.log;

/**
 * mixed logger
 *
 * @author Y
 * @date 2023-10-26
 */
public class MixedLogger extends ConsoleLogger {

    /**
     * fileLogger
     */
    private final FileLogger fileLogger;

    /**
     * MixedLogger
     *
     * @param filePathType 路径类型 absolute/relative
     * @param logFile      日志文件
     */
    public MixedLogger(String filePathType, String logFile) {
        super();
        this.fileLogger = new FileLogger(filePathType, logFile);
    }

    /**
     * log
     */
    @Override
    public void log() {
        super.log();
        fileLogger.log();
    }

    /**
     * log
     *
     * @param str str
     */
    @Override
    public void log(final String str) {
        super.log(str);
        fileLogger.log(str);
    }

    /**
     * log 不换行
     *
     * @param str str
     */
    @Override
    public void logWithoutLine(String str) {
        super.logWithoutLine(str);
        fileLogger.logWithoutLine(str);
    }
}
